package cn.xspace.wnx.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.TextView;

import com.squareup.picasso.Picasso;
import com.xspace.android.xafcommon.util.LogUtil;
import com.xspace.android.xafcommon.view.RoundAngleImageView;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import cn.xspace.wnx.R;

/**
 * Created by Administrator on 2016/10/27 0027.
 */
public class GridViewAdapter  extends BaseAdapter {
    private Context context;
    private List<String> list = new ArrayList<String>();
    private LayoutInflater inflater;
    public GridViewAdapter(Context context,List<String> list){
        this.context = context;
        this.list = list;
        inflater = LayoutInflater.from(context);

    }
    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int position) {
        return list.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        convertView = inflater.inflate(R.layout.list_item_gridview, null);
        ViewHolder vh = new ViewHolder();
        vh.txt_type = (TextView) convertView.findViewById(R.id.txt_type);
        vh.txt_type.setText(list.get(position).toString());
        return convertView;
    }
    class ViewHolder {
        TextView txt_type;
    }
}
